
#ifndef _ICC_H_
#define _ICC_H_

#include <stdint.h>

typedef struct icc_tag
{
	uint8_t active_flag;
	uint8_t byte_direction;		//字节发送到顺序，lsb或msb。正向卡或反向卡
	uint8_t voltage;			//上电电压
	uint8_t retransmit_times;	//字节重传次数，0为不重传
	uint8_t protocol_type;		//选择的通信协议类型
	uint8_t FiDi;				//ETU编码Fi,Di
	uint8_t stop_bit;				//字节停止位个数
	uint16_t char_duration;		//连续两字节起始位最小间隔时间
	uint16_t extra_guardtime;		//连续两个字节间的保护时间
	uint16_t oppositive_guardtime;	//反向两字节起始位间隔时间
	//T = 0
	uint32_t WWT;				//工作等待时间
	//T = 1
	uint32_t MultipleBWT;			
	uint32_t BWT;				//T=1,块等待时间
	uint32_t CWT;				//T=1,块内字节间等待时间
	uint8_t IFSC;				//T=1,信息块最大传输数据量
	uint8_t SN_out;
	uint8_t SN_in;
	uint8_t error_countor;
 	uint8_t work_mode;
 }icc_t;

void ICC_DefaultInit(icc_t *icc);
void ICC_Config(icc_t *icc);
void ICC_SetWorkMode(uint8_t work_mode);


#endif

